﻿using Freebase4net.Interfaces;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Freebase4net.Operators.Bases
{
    public class OperatorsManager
    {
        /// <summary>
        /// Create operator that will combine few operators passed in
        /// </summary>
        /// <param name="operators"></param>
        /// <returns></returns>
        public IOperator CreateMultiOparator(params IOperator[] operators)
        {
            return new MultiOperator(operators);
        }

        /// <summary>
        /// Create "Like" operator that will add "~=" to name of MQL query
        /// </summary>
        /// <param name="key"></param>
        /// <returns></returns>
        public IOperator CreateLikeOperator(string key)
        {
            return new LikeOperator(key);
        }

        /// <summary>
        /// Create "One Of" operator that will add "|=" to name of MQL query
        /// </summary>
        /// <param name="key"></param>
        /// <returns></returns>
        public IOperator CreateOneOfOperator(params object[] key)
        {
            return new OneOfOperator(key);
        }

        /// <summary>
        /// Create "But Not" operator that will add "!=" to name of MQL query
        /// </summary>
        /// <param name="key"></param>
        /// <returns></returns>
        public IOperator CreateButNotOperator(params string[] key)
        {
            return new ButNotOperator(key);
        }

        /// <summary>
        /// Create "And" operator that will add "and:" to second value
        /// </summary>
        /// <param name="key"></param>
        /// <returns></returns>
        public dynamic CreateAndOperator(string value1, string value2)
        {
            return new AndOperator(value1, value2);
        }

        public dynamic CreateGreaterThenOperator(string value)
        {
            return new GreaterThenOperator(value);
        }

        public dynamic CreateGreaterThenOrEqualOperator(string value)
        {
            return new GreaterThenOrEqualOperator(value);
        }

        public dynamic CreateLessThenOperator(string value)
        {
            return new LessThenOperator(value);
        }

        public dynamic CreateLessThenOrEqualOperator(string value)
        {
            return new LessThenOrEqualOperator(value);
        }
    }
}
